<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" 
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity6">
<head>
    <meta charset="UTF-8">
    <title>个人资料</title>
    <style>
        .profile-header {
            background: linear-gradient(135deg, var(--primary-color) 0%, #2e59d9 100%);
            color: white;
            border-radius: 1rem;
            padding: 2rem;
            margin-bottom: 1.5rem;
            position: relative;
            overflow: hidden;
        }
        
        .profile-header::after {
            content: '';
            position: absolute;
            top: -50%;
            right: -50%;
            width: 100%;
            height: 100%;
            border-radius: 50%;
            background: rgba(255, 255, 255, 0.1);
            z-index: 0;
        }
        
        .profile-avatar {
            width: 100px;
            height: 100px;
            border-radius: 50%;
            background-color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 3rem;
            color: var(--primary-color);
            margin-bottom: 1rem;
            position: relative;
            z-index: 1;
            box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
        }
        
        .profile-nav .nav-link {
            padding: 1rem;
            border-radius: 0.5rem;
            margin-bottom: 0.5rem;
            font-weight: 500;
            color: var(--text-color);
            transition: all 0.3s;
        }
        
        .profile-nav .nav-link:hover {
            background-color: #f8f9fc;
        }
        
        .profile-nav .nav-link.active {
            background-color: var(--primary-color);
            color: white;
            box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
        }
        
        .profile-nav .nav-link i {
            margin-right: 0.75rem;
            width: 1.25rem;
            text-align: center;
        }
        
        .activity-item {
            padding: 1rem;
            border-radius: 0.5rem;
            background-color: #fff;
            margin-bottom: 1rem;
            transition: all 0.3s;
        }
        
        .activity-item:hover {
            transform: translateX(5px);
            box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.05);
        }
    </style>
</head>
<body>
    <div th:replace="~{layout :: body(content=~{::content})}">
        <div th:fragment="content">
            <!-- 页面标题 -->
            <div class="page-header mb-4">
                <h1>个人资料</h1>
                <nav aria-label="breadcrumb">
                    <ol class="breadcrumb">
                        <li class="breadcrumb-item"><a th:href="@{/home}">首页</a></li>
                        <li class="breadcrumb-item"><a th:href="@{/user/dashboard}">用户仪表盘</a></li>
                        <li class="breadcrumb-item active" aria-current="page">个人资料</li>
                    </ol>
                </nav>
            </div>
            
            <!-- 资料头部 -->
            <div class="profile-header shadow-sm">
                <div class="row align-items-center">
                    <div class="col-md-3 text-center text-md-start">
                        <div class="profile-avatar mx-auto mx-md-0">
                            <i class="bi bi-person"></i>
                        </div>
                    </div>
                    <div class="col-md-9 text-center text-md-start mt-4 mt-md-0">
                        <h2 class="fw-bold mb-2">用户名</h2>
                        <p class="mb-2">
                            <span class="badge bg-primary rounded-pill me-2">用户</span>
                            <span class="badge bg-light text-dark rounded-pill">注册于 2023年10月15日</span>
                        </p>
                        <div class="d-flex gap-2 flex-wrap justify-content-center justify-content-md-start">
                            <button class="btn btn-light btn-sm">
                                <i class="bi bi-pencil me-2"></i>编辑资料
                            </button>
                            <button class="btn btn-light btn-sm">
                                <i class="bi bi-key me-2"></i>修改密码
                            </button>
                        </div>
                    </div>
                </div>
            </div>
            
            <div class="row g-4">
                <!-- 侧边导航 -->
                <div class="col-lg-3">
                    <div class="card border-0 shadow-sm">
                        <div class="card-body px-0 py-2">
                            <div class="profile-nav">
                                <a href="#basic" class="nav-link active" data-bs-toggle="pill">
                                    <i class="bi bi-person"></i>基本信息
                                </a>
                                <a href="#security" class="nav-link" data-bs-toggle="pill">
                                    <i class="bi bi-shield-lock"></i>安全设置
                                </a>
                                <a href="#activity" class="nav-link" data-bs-toggle="pill">
                                    <i class="bi bi-activity"></i>账户活动
                                </a>
                            </div>
                        </div>
                    </div>
                </div>
                
                <!-- 主内容 -->
                <div class="col-lg-9">
                    <div class="tab-content">
                        <!-- 基本信息 -->
                        <div class="tab-pane fade show active" id="basic">
                            <div class="card border-0 shadow-sm">
                                <div class="card-header bg-white border-0 py-3">
                                    <h5 class="mb-0"><i class="bi bi-person-lines-fill text-primary me-2"></i>基本信息</h5>
                                </div>
                                <div class="card-body p-4">
                                    <form>
                                        <div class="row mb-4">
                                            <div class="col-md-6 mb-3 mb-md-0">
                                                <label for="username" class="form-label">用户名</label>
                                                <div class="input-group">
                                                    <span class="input-group-text bg-light">
                                                        <i class="bi bi-person text-primary"></i>
                                                    </span>
                                                    <input type="text" class="form-control" id="username" value="用户名" disabled>
                                                </div>
                                                <small class="text-muted">用户名创建后不可修改</small>
                                            </div>
                                            <div class="col-md-6">
                                                <label for="email" class="form-label">电子邮件</label>
                                                <div class="input-group">
                                                    <span class="input-group-text bg-light">
                                                        <i class="bi bi-envelope text-primary"></i>
                                                    </span>
                                                    <input type="email" class="form-control" id="email" value="user@example.com">
                                                </div>
                                            </div>
                                        </div>
                                        
                                        <div class="row mb-4">
                                            <div class="col-md-6 mb-3 mb-md-0">
                                                <label for="firstName" class="form-label">姓</label>
                                                <input type="text" class="form-control" id="firstName" placeholder="请输入您的姓">
                                            </div>
                                            <div class="col-md-6">
                                                <label for="lastName" class="form-label">名</label>
                                                <input type="text" class="form-control" id="lastName" placeholder="请输入您的名">
                                            </div>
                                        </div>
                                        
                                        <div class="mb-4">
                                            <label for="bio" class="form-label">个人简介</label>
                                            <textarea class="form-control" id="bio" rows="3" placeholder="介绍一下自己..."></textarea>
                                        </div>
                                        
                                        <div class="text-end">
                                            <button type="reset" class="btn btn-light me-2">重置</button>
                                            <button type="submit" class="btn btn-primary">保存更改</button>
                                        </div>
                                    </form>
                                </div>
                            </div>
                        </div>
                        
                        <!-- 安全设置 -->
                        <div class="tab-pane fade" id="security">
                            <div class="card border-0 shadow-sm mb-4">
                                <div class="card-header bg-white border-0 py-3">
                                    <h5 class="mb-0"><i class="bi bi-key text-warning me-2"></i>密码</h5>
                                </div>
                                <div class="card-body p-4">
                                    <form>
                                        <div class="mb-3">
                                            <label for="currentPassword" class="form-label">当前密码</label>
                                            <div class="input-group">
                                                <span class="input-group-text bg-light">
                                                    <i class="bi bi-lock text-primary"></i>
                                                </span>
                                                <input type="password" class="form-control" id="currentPassword" placeholder="请输入当前密码">
                                                <button class="btn btn-outline-secondary password-toggle" type="button">
                                                    <i class="bi bi-eye"></i>
                                                </button>
                                            </div>
                                        </div>
                                        <div class="mb-3">
                                            <label for="newPassword" class="form-label">新密码</label>
                                            <div class="input-group">
                                                <span class="input-group-text bg-light">
                                                    <i class="bi bi-shield-lock text-primary"></i>
                                                </span>
                                                <input type="password" class="form-control" id="newPassword" placeholder="请输入新密码">
                                                <button class="btn btn-outline-secondary password-toggle" type="button">
                                                    <i class="bi bi-eye"></i>
                                                </button>
                                            </div>
                                        </div>
                                        <div class="mb-4">
                                            <label for="confirmPassword" class="form-label">确认新密码</label>
                                            <div class="input-group">
                                                <span class="input-group-text bg-light">
                                                    <i class="bi bi-check2-square text-primary"></i>
                                                </span>
                                                <input type="password" class="form-control" id="confirmPassword" placeholder="请再次输入新密码">
                                                <button class="btn btn-outline-secondary password-toggle" type="button">
                                                    <i class="bi bi-eye"></i>
                                                </button>
                                            </div>
                                        </div>
                                        <div class="text-end">
                                            <button type="reset" class="btn btn-light me-2">取消</button>
                                            <button type="submit" class="btn btn-primary">更新密码</button>
                                        </div>
                                    </form>
                                </div>
                            </div>
                            
                            <div class="card border-0 shadow-sm">
                                <div class="card-header bg-white border-0 py-3">
                                    <h5 class="mb-0"><i class="bi bi-shield-check text-success me-2"></i>安全选项</h5>
                                </div>
                                <div class="card-body p-4">
                                    <div class="list-group">
                                        <div class="list-group-item border-0 px-0 py-3">
                                            <div class="d-flex justify-content-between align-items-center">
                                                <div>
                                                    <h6 class="mb-1 fw-bold">登录通知</h6>
                                                    <p class="mb-0 text-muted">当有新设备登录时通过邮件通知您</p>
                                                </div>
                                                <div class="form-check form-switch">
                                                    <input class="form-check-input" type="checkbox" role="switch" id="loginNotification" checked>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="list-group-item border-0 px-0 py-3">
                                            <div class="d-flex justify-content-between align-items-center">
                                                <div>
                                                    <h6 class="mb-1 fw-bold">两步验证</h6>
                                                    <p class="mb-0 text-muted">增加额外的安全层，使用手机验证码登录</p>
                                                </div>
                                                <div class="form-check form-switch">
                                                    <input class="form-check-input" type="checkbox" role="switch" id="twoFactorAuth">
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        
                        <!-- 账户活动 -->
                        <div class="tab-pane fade" id="activity">
                            <div class="card border-0 shadow-sm">
                                <div class="card-header bg-white border-0 py-3">
                                    <h5 class="mb-0"><i class="bi bi-clock-history text-info me-2"></i>最近活动</h5>
                                </div>
                                <div class="card-body p-4">
                                    <div class="activity-item">
                                        <div class="d-flex justify-content-between align-items-start">
                                            <div>
                                                <h6 class="mb-1 fw-bold">系统登录</h6>
                                                <p class="mb-0 text-muted">您使用Chrome浏览器从192.168.1.1登录了系统</p>
                                            </div>
                                            <div class="text-muted small">刚刚</div>
                                        </div>
                                    </div>
                                    
                                    <div class="activity-item">
                                        <div class="d-flex justify-content-between align-items-start">
                                            <div>
                                                <h6 class="mb-1 fw-bold">密码修改</h6>
                                                <p class="mb-0 text-muted">您更新了账户密码</p>
                                            </div>
                                            <div class="text-muted small">30天前</div>
                                        </div>
                                    </div>
                                    
                                    <div class="activity-item">
                                        <div class="d-flex justify-content-between align-items-start">
                                            <div>
                                                <h6 class="mb-1 fw-bold">账户创建</h6>
                                                <p class="mb-0 text-muted">您的账户已成功创建</p>
                                            </div>
                                            <div class="text-muted small">60天前</div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            
            <script>
                document.addEventListener('DOMContentLoaded', function() {
                    // 密码显示切换
                    const toggleButtons = document.querySelectorAll('.password-toggle');
                    toggleButtons.forEach(button => {
                        button.addEventListener('click', function() {
                            const input = this.previousElementSibling;
                            const type = input.getAttribute('type') === 'password' ? 'text' : 'password';
                            input.setAttribute('type', type);
                            
                            const icon = this.querySelector('i');
                            icon.classList.toggle('bi-eye');
                            icon.classList.toggle('bi-eye-slash');
                        });
                    });
                });
            </script>
        </div>
    </div>
</body>
</html> 